package com.wie.staffhubpro.controller;

import com.wie.staffhubpro.domain.dto.IndicatorSubmitDTO;
import com.wie.staffhubpro.domain.entity.Result;
import com.wie.staffhubpro.domain.entity.SingleIndicator;
import com.wie.staffhubpro.service.IndicatorService;
import com.wie.staffhubpro.service.SingleIndicatorService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@Slf4j
@CrossOrigin
@RestController
@RequestMapping("/ind")
public class IndicatorController {

    @Autowired
    private IndicatorService indicatorService;
    @Autowired
    private SingleIndicatorService singleIndicatorService;

    /**
     * 评分
     */
    @PostMapping("/rate")
    public Result rate (@RequestBody IndicatorSubmitDTO indicatorSubmitDTO) {
        log.info("评分: {}", indicatorSubmitDTO);
        singleIndicatorService.rate(indicatorSubmitDTO);
        return Result.success();
    }

}
